/**
 * 
 */
package wdmsim;

import java.util.Vector;

import multidomain.TED.TableRow;

/**
 * @author alissonslp
 *
 */
public class Path extends Link implements Cloneable{

	Vector<Lightpath> lightpaths;
	
	public Path() {
		this.lightpaths = new Vector<Lightpath>();
	}
	
	public Object clone() throws CloneNotSupportedException {
	    Path clone = (Path)super.clone();
	    return clone;
	}
	
	public void addLightpath(Lightpath lightpath) {
		// se o wavelength desse lightpath for igual ao wavelength do ultimo lightpath armazenado
		// na verdade eles sao um unico lightpath
		if(!lightpaths.isEmpty() && lightpath.getWavelength()==lightpaths.lastElement().getWavelength()) {
			Lightpath.splitLightpaths(lightpaths.lastElement(), lightpath);
		}
		else {
			lightpaths.add(lightpath);
		}
	}
	

	public void removeLightpath(Lightpath lightpath) {
		lightpaths.remove(lightpath);
		
	}
	
	public Vector<Lightpath> getLightpaths() {
		return lightpaths;
	}
	
	public Lightpath getLightpath(int i) {
		return lightpaths.get(i);
	}

	@Override
	public int getWeight() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void setWeight(int weight) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int getTotalAvailableBandwidth() {
		// TODO Auto-generated method stub
		return 0;
	}

	/* (non-Javadoc)
	 * @see wdmsim.Link#getNumFreeWavelengths()
	 */
	@Override
	public int getNumFreeWavelengths() {
		// TODO Auto-generated method stub
		return 0;
	}
}
